package io.gitee.kotle.android.mvvm.binding

import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding
import io.gitee.kotle.android.mvvm.MvvmActivity
import io.gitee.kotle.android.mvvm.mvvminterface.MvvmViewType

/**
 * 支持通过泛型创建ViewBinding
 */
open class MvvmBindingActivity<Binding : ViewBinding> : MvvmActivity(),
    IMvvmBinding<Binding> by MvvmBindingImpl() {

    override fun onMvvmCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): MvvmViewType {
        return MvvmViewType.ViewBindingType(
            onCreateViewBinding(this, inflater, container)
        )
    }
}